package com.cskaoyan.controller.stage;

import com.cskaoyan.model.Brand;
import com.cskaoyan.model.bo.BaseParamBO;
import com.cskaoyan.model.vo.BrandDataVO;
import com.cskaoyan.model.vo.CollectorRespVO;
import com.cskaoyan.model.vo.WxBrandDataVO;
import com.cskaoyan.service.BrandService;
import com.cskaoyan.service.CollectorService;
import com.cskaoyan.service.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: 微信小程序
 * @description:
 * @author: Wangtianhao
 * @create: 2022-05-09 17:18
 **/
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    WxBrandService wxbrandService;

    /*
     * description 获取品牌商列表
     * @author Wangtianhao
     * @date 2022-05-09 19:38
     */
    @GetMapping("list")
    public CollectorRespVO brandList(BaseParamBO param){
        WxBrandDataVO wxBrandDataVO = wxbrandService.queryWxBrandList(param);
        return CollectorRespVO.ok(wxBrandDataVO);
    }

    /*
     * description 获取品牌信息
     * @author Wangtianhao
     * @date 2022-05-09 19:39
     */
    @GetMapping("detail")
    public CollectorRespVO brandList(Integer id){
        Brand brand = wxbrandService.queryWxBrandDetail(id);
        return CollectorRespVO.ok(brand);
    }

}
